# -*- coding: utf-8 -*-

'''
/**
 * @addtogroup msg_hj1239_cmd_base
 * msg_hj1239_cmd_base
 * @{
 */
/**
 * @file        msg_hj1239_cmd_base.py
 * @brief       XXXX
 * @note        XXXX
 * @author      靳普诏(puzhao.jin@hopechart.com)
 * @date        2023/09/24
 * @version     1.0

 * @par         修改日志
 * <table>
 * <tr><th>Date         <th>Version     <th>Author      <th> Description
 * <tr><td>2023/09/24   <td>1.0         <td>靳普诏       <td> 创建初始版本
 * @copyright   xxxx
 */
'''

import sys
import os
from abc import ABC, abstractmethod
import socket

class TMsgHJ1239CmdBase:
    def __init__(self, log_file_handle = None) -> None:
        self.__log_file_handle = log_file_handle
        pass

    def Log(self, log:str, end = '\n'):
        f_handle = self.__log_file_handle
        print(log, end = end)
        f_handle.write(log + end)
    
    @abstractmethod
    def Decode(self, code: bytes) -> bool:
        return True

    @abstractmethod
    def Encode(self) -> bytes:
        code = b''
        return code
    
    @abstractmethod
    def MessageParser(self, client_socket: socket.socket, addr: str, recv_data: bytes) -> None:
        return


if __name__ == "__main__":
    ## 获取当前脚本所在的目录
    SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
    # 输出目录路径
    print("SCRIPT_DIR: "+ SCRIPT_DIR)

    ## 获取脚本传参
    argv = sys.argv
    argc = len(argv)
    # 打印命令行参数
    #for i in range(1, argc):
        #print("参数", i, ":", argv[i])
        
    print("============= BIGEN: msg_hj1239_cmd_base.py =============")




    print("============= END: msg_hj1239_cmd_base.py =============")



## Generated on "2023-09-24 00:09:30" by the tool "gen_hq_file.py >> V20230509_1" 